package cn.hnu.jpa.jpaExample.Composite_primary_key;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

@Entity
@Table(name = "customer")
@IdClass(CustomerPK.class)
public class IDClassTest implements Serializable{

	@Override
	public String toString() {
		return "id = "+id+"\temail = "+email+"\tname = "+name;
//		System.out.println("id = "+id+"\temail = "+emal+"\tname = "+name);
	}

	/**
	 * 通过@IdClass 注释在实体中标注复合主键。
	 */
	private static final long serialVersionUID = -3175414431129485694L;
	
	private Integer id;
	
	private String email;
	
	private String name;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	@Id
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	@Id
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	
}
